import '../css/style.scss';
import {queryOrder,log} from './urlconfig/config.js';
var token;
if(localStorage.token != null){
    token=localStorage.token
}
var edition = localStorage.getItem("edition");
var channel = localStorage.getItem("channel");
var sys = localStorage.getItem("sys");
var cpuid = localStorage.getItem("cpuid");
$(function (){
    $.ajax({
        type:'post',
        url:queryOrder,
        dataType:'json',
        data:{
            token:token
        },
        success:function (res){
            if(res.code === 200) {
                var sec=res.data.secretkey;
                $(".sec").html(sec)
            }
        },
        error:function (err){
            console.log(err)
        }
    })
});
/*立即激活日志*/
$(".btnclick").click(function (){
    var tablog=$(this).attr("data-log");
    tab(tablog);
    if('Widget' in window){
        Widget.slotOpenExternalBrowser('https://setup.office.com');
    }
});
function tab(name){
    $.ajax({
        type:'GET',
        url:log+ name+'/'+ channel+'/'+ edition + '/'+sys+'/'+cpuid,
        dataType: 'json',
        success:function(res) {
            if(res.code==200){
                console.log(res.msg)
            }
        },
        error:function(err) {
            console.log(err)
        }
    });
}

import './common.js';